package com.xiangxiao.rpan.storage.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/8/25 16:11
 */
@Component(value = "transferByDirectManager")
public class TransferByDirectManager implements TransferFileByDirectTool {
  @Autowired
  @Qualifier(value = "transferFileByDirectToolSelector")
  private TransferFileByDirectToolSelector transferFileByDirectToolSelector;

  @Override
  public Long copyFileToStorage(File srcFile, File desFile) {
    return transferFileByDirectToolSelector.select().copyFileToStorage(srcFile, desFile);
  }

  @Override
  public Long copyFileFromStorage(File srcFile, File desFile) {
    return transferFileByDirectToolSelector.select().copyFileFromStorage(srcFile, desFile);
  }
}
